<?php

use yii\db\Migration;

/**
 * Class m200621_070449_membertokens
 */
class m200621_070449_membertokens extends Migration
{
    public function safeUp()
    {
        $this->execute(
            "CREATE TABLE {{%membertokens}} (
                `tokenId` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Token编号',
                `memberId` int(11) DEFAULT NULL COMMENT '用户编号',
                `mobile` varchar(64) DEFAULT NULL COMMENT '手机号码',
                `memberKey` varchar(300) DEFAULT NULL COMMENT '用户标识',
                `token` varchar(200) DEFAULT NULL COMMENT 'token',
                `refreshToken` varchar(200) DEFAULT NULL COMMENT '用于刷新的Token',
                `ctime` int(11) DEFAULT NULL COMMENT '创建时间',
                PRIMARY KEY (`tokenId`)
            ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8"
        );
    }

    public function safeDown()
    {
        $this->dropTable('{{%membertokens}}');
    }
}
